package com.koron.css2.clientCenter.Enum;

public enum MrAbWaterExportEnum {

    book_no("册本号","IFNULL(X.BOOK_NO,'') book_no"),
    user_no("用户编号","IFNULL(X.USER_NO,'') user_no"),
    ctm_name("客户名称","IFNULL(X.CTM_NAME,'') ctm_name"),
    setup_meter_addr("装表地址","IFNULL(X.SETUP_METER_ADDR,'') setup_meter_addr"),
    ctm_addr("客户地址","IFNULL(X.CTM_ADDR,'') ctm_addr"),

    account_period("账期","IFNULL(Z.ACCOUNT_PERIOD,'') account_period"),
    meter_reading_date("抄表日期","IFNULL(Z.METER_READING_DATE,'') meter_reading_date"),
    status("抄表状态","IFNULL(Z.STATUS,'') status"),

    prior_period_num("上期止码","IFNULL(Z.PRIOR_PERIOD_NUM,'') prior_period_num"),
    currend_period_num("本期抄码","IFNULL(Z.CURREND_PERIOD_NUM,'') currend_period_num"),
    currend_period_water("本期水量","IFNULL(Z.CURREND_PERIOD_WATER,'') currend_period_water"),
    add_water("增减水量","IFNULL(Z.ADD_WATER,'') add_water"),
    share_water("分摊水量","IFNULL(Z.SHARE_WATER,'') share_water"),
    reality_water("实际用水量","IFNULL(Z.REALITY_WATER,'') reality_water"),
    prior_period_water("上期水量","IFNULL(Z.PRIOR_PERIOD_WATER,'') prior_period_water"),
    comments("备注","IFNULL(Z.COMMENTS,'') comments"),
    meter_reading_staff_name("抄表员","IFNULL(Z.METER_READING_STAFF_NAME,'') meter_reading_staff_name"),
    meter_bore("水表口径","IFNULL(W.METER_BORE,'') meter_bore"),
    business_area("营业区域","IFNULL(X.BUSINESS_AREA,'') business_area")

    ;

    private String excelName;
    private String fieldName;

    public String getExcelName() {
        return excelName;
    }

    public void setExcelName(String excelName) {
        this.excelName = excelName;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    //构造方法
    private MrAbWaterExportEnum(String excelName, String filedName) {
        this.excelName = excelName;
        this.fieldName = filedName;
    }

    /**
     * 根据前端选中字段获取枚举名
     * @param index
     * @return
     */

    public static  String  getName(String index){
        for(MrAbWaterExportEnum c: MrAbWaterExportEnum.values()){
            if(c.name().equals(index)){
                return c.name();
            }
        }
        return null;

    }

    /**
     * 根据枚举名获取需要查询的字段名
     * @param name
     * @return
     */
    public static String fieldName(String name) {
        for (MrAbWaterExportEnum c : MrAbWaterExportEnum.values()) {
            if(c.name().equals(name)) {
                return c.fieldName;
            }
        }
        return null;
    }

    /**
     * 根据枚举名获取excel表头名
     * @param name
     * @return
     */
    public static String excelName(String name) {
        for (MrAbWaterExportEnum c : MrAbWaterExportEnum.values()) {
            if(c.name().equals(name)) {
                return c.excelName;
            }
        }
        return null;
    }
}
